﻿using System.Collections.Generic;
using JobUtil.GeneralLib;
using System.Data;
using Oracle.DataAccess.Client;
using System.Linq;

namespace JobUtil.DalLib
{
    public class StationDataAccess : DbConnectorClass
    {
        public List<StationEntity> RetrieveStation(decimal langId)
        {
            //Call SP from DataBase
            var retrieveStations = new OracleCommand("S669_PA_PTCAR.P_GET_PTCAR", OConnection)
                                       {CommandType = CommandType.StoredProcedure};

            retrieveStations.Parameters.Add("pin_lang", OracleDbType.Decimal).Value = langId;
            retrieveStations.Parameters.Add("poc_ptcar", OracleDbType.RefCursor).Direction = ParameterDirection.Output;

            try
            {
                OracleDataReader ptcarReader = retrieveStations.ExecuteReader();
              /* using( )
               {
              //  List<StationEntity> returnStationList = ptcarReader.Select(s=>s.)
               }*/



                Disconnect();
            }
            catch { return null; }
            return null;
            
            
        }
    }
}
